package org.mech.sefer.entity.bible.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

import org.mech.sefer.entity.model.AbstractEntity;

/**
 * <p>
 * The Verse represent verse in bible
 * </p>
 * <p>
 * Date: 4.5.2012 14:26:37
 * </p>
 * 
 * @author martin.krajc
 */
@Entity
@Table(name = "T_VERSES")
public class Verse extends AbstractEntity {

	/** The Constant serialVersionUID. */
	private static final long serialVersionUID = -8563398435578006881L;

	/** The id. */
	@Id
	@SequenceGenerator(name = "t_verses_seq", sequenceName = "t_verses_seq", allocationSize = 1)
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "t_verses_seq")
	@Column(name = "id", nullable = false, updatable = false)
	private Long id;

	/** The semantic verse. */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "S_ID")
	private SemanticVerse semanticVerse;

	/** The book. */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "BOOK_ID")
	private Book book;

	/** The text. */
	@Column(name = "TEXT")
	private String text;
	

	/**
	 * {@inheritDoc}
	 */
	public Long getId() {
		return id;
	}

	/**
	 * Sets the id.
	 *
	 * @param id the new id
	 */
	public void setId(Long id) {
		this.id = id;
	}

	/**
	 * Gets the semantic verse.
	 *
	 * @return the semantic verse
	 */
	public SemanticVerse getSemanticVerse() {
		return semanticVerse;
	}

	/**
	 * Sets the semantic verse.
	 *
	 * @param semanticVerse the new semantic verse
	 */
	public void setSemanticVerse(SemanticVerse semanticVerse) {
		this.semanticVerse = semanticVerse;
	}

	/**
	 * Gets the book.
	 *
	 * @return the book
	 */
	public Book getBook() {
		return book;
	}

	/**
	 * Sets the book.
	 *
	 * @param book the new book
	 */
	public void setBook(Book book) {
		this.book = book;
	}

	/**
	 * Gets the text.
	 *
	 * @return the text
	 */
	public String getText() {
		return text;
	}

	/**
	 * Sets the text.
	 *
	 * @param text the new text
	 */
	public void setText(String text) {
		this.text = text;
	}
}
